package com.entity.sys;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author clay
 * @since 2022-02-15
 */
@Data
@TableName("t_menu")
@ApiModel(value="Menu对象", description="")
public class Menu {

    private static final long serialVersionUID = 1L;

    private String id;

    @ApiModelProperty(value = "url")
    private String url;

    @ApiModelProperty(value = "权限编码, 全局唯一, 配合url控制按钮权限")
    private String authCode;

    @ApiModelProperty(value = "path")
    private String path;

    @ApiModelProperty(value = "标题")
    private String title;

    @ApiModelProperty(value = "是否隐藏")
    private Boolean hidden;

    @ApiModelProperty(value = "组件")
    private String component;

    @ApiModelProperty(value = "菜单名")
    private String name;

    @ApiModelProperty(value = "图标")
    @TableField("icon")
    private String icon;

    @ApiModelProperty(value = "是否保持激活")
    @TableField("keep_alive")
    //即前端是否隐藏
    private Boolean keepAlive;

    @ApiModelProperty(value = "是否要求权限")
    @TableField("require_auth")
    private Boolean requireAuth;

    @ApiModelProperty(value = "级别 0 根; 1 菜单; 2 按钮")
    private Integer level;

    @ApiModelProperty(value = "父id")
    @TableField("parent_id")
    private String parentId;

    @ApiModelProperty(value = "是否启用")
    private Boolean enabled;

    //代表表里面没有这个字段
    @ApiModelProperty(value = "子菜单")
    @TableField(exist = false)
    private List<Menu> children;

    @ApiModelProperty(value = "角色列表")
    @TableField(exist = false)
    private List<Role> roles;
}
